<!-- application/layouts/scripts/layout.phtml -->
<?php echo $this->doctype() ?>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<?php echo $this->headMeta(); ?>

<link rel="shortcut icon" href="images/icon.png">

<?php

// Titre de tabulation
echo $this->headTitle('Media Globe');

// Feuilles de style
echo $this->headLink();
echo $this->headScript();
//->headLink(array('rel' => 'shorcut icon', 'type' => 'image/png' , 'href' => $this->baseUrl('images/favicon.png')));
?>



<?php
$login = "";
if (isset($this->connection) && $this->connection)
    $login = $this->connection->login;
$blockToHide = "#bloub-not-connected";
if ($login == "")
    $blockToHide = "#bloub-connected";
?>
<!-- FIXME -->
<script>
// FIXME
$(document).ready(function(){
    $('<?php echo $blockToHide; ?>').hide();
    $('#bloub-form').hide();
    $('#bloub-login').text('<?php echo $login; ?>');
    // FIXME replace box
});
</script>



<?php

$mainMenuHtml = "";
if (isset($this->connection) && $this->connection) {
    $mainMenuHtml = $this->navigation()->menu()->render();
}

$config = Zend_Registry::get('Zend_Config');
$version = 'v' . $config['version'];

$cacheButton = "";
if (isset($this->connection) && $this->connection && $this->connection->profile == 0) {
    $cacheButton = '<a id="mg-cache" class="mg-button" href="';
    $cacheButton .= $this->url(array('controller' => 'index', 'action' => 'emptycache'));
    $cacheButton .= '">';
    $cacheButton .= $this->translate('empty_cache');
    $cacheButton .= '</a>';
}

?>

</head>

<body>

    <header>
        <?php echo $cacheButton; ?>
        <div id='mg-header'>
            <label id='header-title'>. : Media Globe : .</label>
            <label id='version'><?php echo $version; ?></label>
            <!-- FIXME:standalone: < ?php echo '<a id="signout" class="button" href="' . $this->url(array('controller' => 'login', 'action' => 'signout')) . '">' . $this->translate('signout') . '</a>'; } ?> -->
            <?php echo $mainMenuHtml; ?>
        </div>
        <!-- FIXME:standalone: `Connected as` label -->
        <!-- FIXME:i18n: controller/action/locale=fr_FR <a href="< ?php echo $this->baseUrl('/locale/changelocale/locale/fr_FR'); ?>" class="button"> < ?php echo 'locale fr_FR'; ?> </a>-->
    </header>

    <div id="mg-layout-main">
        <?php echo $this->layout()->content; ?>
    </div>
</body>
</html>
